package cn.cvs.service.user;

import cn.cvs.pojo.SysUser;

import java.util.List;

public interface SysUserService {
    /**
     * 验证用户名和密码是否正确
     *
     * @param account
     * @param passWord
     * @return SysUser
     * @throws Exception
     */
    SysUser checkUser(String account, String passWord) throws Exception;

    /**
     * 分页查询
     *
     * @param pageIndex 页码
     * @param pageSize  每页显示的记录数
     * @return
     * @throws Exception
     */
    List<SysUser> findUserByPage(Integer pageIndex, Integer pageSize, String queryRealName, Integer queryRoleId) throws Exception;

    /**
     * 根据ID获取用户对象
     *
     * @param id
     * @return
     * @throws Exception
     */
    SysUser findUserById(String id) throws Exception;

    /**
     * 获取用户总记录
     *
     * @return
     * @throws Exception
     */
    Integer findUserTotalCount(String queryRealName, Integer queryRoleId) throws Exception;

    /**
     * 添加用户
     *
     * @param sysUser
     * @return
     * @throws Exception
     */
    boolean saveSysUser(SysUser sysUser) throws Exception;

    /**
     * 更新用户信息
     *
     * @param sysUser
     * @return
     * @throws Exception
     */
    boolean updateUser(SysUser sysUser) throws Exception;

    /**
     * 通过账号获取用户对象
     *
     * @param account
     * @return
     * @throws Exception
     */
    SysUser findUserByAccount(String account) throws Exception;


    /**
     * 根据用户id修改密码
     *
     * @param id
     * @param newPWD
     * @return
     * @throws Exception
     */
    boolean updatePWD(String id, String newPWD) throws Exception;

    /**
     * 根据Id删除用户
     *
     * @param id
     * @return
     * @throws Exception
     */
    boolean delUserById(String id) throws Exception;
}
